package com.malty.mall.domain.dto.req;

import com.malty.mall.domain.entity.ums.UmsResourceType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;

/**
 * @author malty
 */
@Data
@ApiModel("资源类型")
@NoArgsConstructor
public class UmsResourceTypeParam {
    @ApiModelProperty("资源类型名称")
    @NotEmpty(message = "资源名称不能为空")
    private String typeName;
    @ApiModelProperty("排序")
    private Integer sort;

    public UmsResourceTypeParam(UmsResourceType resourceType) {
        this.typeName = resourceType.getTypeName();
        this.sort = resourceType.getSort();
    }
}
